<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>5_操作select列表框</title>
    <script src="./lib/angularjs.js"></script>
</head>

<body ng-app="myApp" ng-controller="myCtrl">
    <select name="" id="" ng-options="v.value as v.name for v in data" ng-model="city">
    </select>
    <div>{{city}}</div>
</body>

<script>
    const myApp = angular.module("myApp", [])
    myApp.controller("myCtrl", ["$scope", function ($scope) {
        $scope.city = "guangzhou"
        $scope.data = [{
            name: "北京",
            value: "beijing",
        }, {
            name: "上海",
            value: "shanghai",
        }, {
            name: "广州",
            value: "guangzhou",

        }]
    }])
</script>

</html>